package com.ccc.ka.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import com.ccc.ka.util.KAResponse;
import org.springframework.web.bind.annotation.*;
import com.ccc.ka.service.ITeamMemberService;
import com.ccc.ka.entity.TeamMember;
import com.ccc.ka.util.BaseController;

/**
 * 
 * @author ccc
 * @since 2023-02-28
 */
@RestController
@RequestMapping("/teamMember")
public class TeamMemberController extends BaseController {

@Autowired
private ITeamMemberService teamMemberService;

@PostMapping("/saveTeamMember")
public KAResponse saveTeamMember(TeamMember teamMember){
    return success(teamMemberService.save(teamMember));
}

@DeleteMapping("/delTeamMember")
public KAResponse delTeamMember(TeamMember teamMember){
    return success(teamMemberService.removeById(teamMember));
}

@PutMapping("/updTeamMember")
public KAResponse putTeamMember(TeamMember teamMember){
    return success(teamMemberService.updateById(teamMember));
}

@GetMapping("/getTeamMember")
public KAResponse getTeamMember(String id){
    return success(teamMemberService.getById(id));
}

@GetMapping("/getTeamMemberList")
public KAResponse getTeamMemberList(TeamMember teamMember){
    return success(teamMemberService.list());
}

@GetMapping("/getTeamMemberPage")
public KAResponse getTeamMemberPage(TeamMember teamMember){
    return success(teamMemberService.list());
}

}
